<%@ page language="java"  pageEncoding="utf-8"%>
<%@ page import="java.util.*,Login.src.domain.User" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page import="db.DbClass" %>
<%@ page import="java.sql.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <script src='http://codepen.io/assets/libs/fullpage/jquery.js'></script>
<script src="js/index.js"></script>
<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
<script src="/follow.js" type="text/javascript"></script>
<head>
<base href="<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/" %>"/>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0"> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
 <meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- Iconos -->
	<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

    <link rel="stylesheet" href="css/style.css" media="screen" type="text/css" />
    <style type="text/css">
    body,td,th {
	font-family: "Open Sans", Arial, Helvetica, Sans-serif, Verdana, Tahoma;
	color: #5A7EB4;
}
    </style>
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <div id="index" ></div>
  <div class="b1"><strong>个人留言管理</strong></div>
    <%-- <%
        String name=(String)request.getAttribute("users");
        if(name==null||name.equals("")){
        response.sendRedirect("userlogin.jsp");
        }
     %> --%>
    <%
      String email,subject,memo;
     String name=(String)session.getAttribute("username"); 
      /* List<User> name=(List<User>)session.getAttribute("users"); */
      Connection conn=new DbClass().getConn();
      Statement smt=conn.createStatement();
      ResultSet rs;
      String sql;
      sql="select name,email,subject,memo from message where name='"+name+"'";
           
      rs=smt.executeQuery(sql); 
      out.print("<center>"); 
      out.print("<table border=1>");
      
      out.print("<td bgcolor=yellow>姓名</td>");
      out.print("<td bgcolor=yellow>E-Mail</td>");
      out.print("<td bgcolor=yellow>主题</td>");
      out.print("<td bgcolor=yellow>内容</td>");
      out.print("<td bgcolor=yellow>删除</td>");
      while(rs.next()) 
{ 
name=rs.getString(1); 
email=rs.getString(2); 
subject=rs.getString(3);  
memo=rs.getString(4); 
//out.print("<center>"); 
//out.print("<table border=1>"); 
out.print("<tr>");
out.print("<td>"+name+"</td>"); 
out.print("<td>"+email+"</td>"); 
out.print("<td>"+subject+"</td>"); 
out.print("<td>"+memo+"</td>"); 
out.print("<td><a href='delete.jsp?subject="+subject+"'>删除</a></td>");
out.print("</tr>");
//out.print("</table><p>"); 
} 
out.print("</table><p>"); 
 %>
  </body>
</html>
